From d619a78aeb5198af30001bc715fc5d8b732d6420 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 20 Jun 2014 20:46:49 -0400 Subject: [PATCH] gdkwindow: Don't create a subsurface if we don't need to In the case we have a native window, we don't need to crop it to a non-native subrectangle, as abs_x / abs_y / width / height are all 0. --- gdk/gdkwindow.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 2853a30f75..7638a33655 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -3004,11 +3004,18 @@ _gdk_window_ref_cairo_surface (GdkWindow *window) surface = get_window_surface (window); - return cairo_surface_create_for_rectangle (surface, - window->abs_x, - window->abs_y, - window->width, - window->height); + if (gdk_window_has_impl (window)) + { + return surface; + } + else + { + return cairo_surface_create_for_rectangle (surface, + window->abs_x, + window->abs_y, + window->width, + window->height); + } } /** -- 2.30.2